<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>库存管理管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/tbShopProduct/">商品上架</a></li>
		<li hidden="hidden"><a href="${ctx}/sys/tbShopProduct/form"  >库存管理添加</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="tbShopProduct" action="${ctx}/sys/tbShopProduct/listpage" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>商品名称：</label>
				<form:input path="productName" htmlEscape="false" maxlength="11" class="input-medium"/>
			</li>

			<li> &nbsp; &nbsp; 商品类别:
				<select name="shopCategoyr" class="input-medium">
					<option value="" >请选择</option>
					<option value="4" <c:if test="${tbShopProduct.shopCategoyr==4}">selected</c:if>>便利生活</option>
					<option value="3" <c:if test="${tbShopProduct.shopCategoyr==3}">selected</c:if>>生活预定</option>
					<option value="2" <c:if test="${tbShopProduct.shopCategoyr==2}">selected</c:if>>海外代购</option>
				</select>
					<%--<form:input path="reserveFlag" htmlEscape="false" maxlength="3" class="input-medium"/>--%>
			</li>

			<li> &nbsp; &nbsp; 商品状态:
				<select name="isStatus" class="input-medium">
					<option value="" >请选择</option>
					<option value="1" <c:if test="${tbShopProduct.isStatus eq '1'}">selected</c:if>>已上架</option>
					<option value="0" <c:if test="${tbShopProduct.isStatus eq '0'}">selected</c:if>>已下架</option>
				</select>
					<%--<form:input path="reserveFlag" htmlEscape="false" maxlength="3" class="input-medium"/>--%>
			</li>
			<li class="btns">&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<span><font style="color: #00A6C7">${message1}</font></span>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>ID</th>
				<th>商品名称</th>
				<th>条形码</th>
				<%--<th>是否为预定商品</th>--%>
				<th>属性</th>
				<th>价格</th>
				<c:choose>
					<c:when test="${overse eq 1}">
					</c:when>
					<c:otherwise>
						<th>库存</th>
					</c:otherwise>
				</c:choose>
				<th>单位</th>
				<th>是否可用物业钱包</th>
				<th>商品类别</th>
				<th>商品状态</th>
			<%--	<th>创建时间</th>--%>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="tbShopProduct">
			<tr>
				<td>
						${tbShopProduct.id}
				</td>
				<td><%--<a href="${ctx}/sys/tbShopProduct/form?id=${tbShopProduct.id}">--%>
					${tbShopProduct.productName}
				<%--</a>--%></td>

				<td>
						${tbShopProduct.barcode}
				</td>
				<%--<td>
						<c:choose>
							<c:when test="${tbShopProduct.reserveFlag==0}">
								<span>否</span>
							</c:when>
							<c:when test="${tbShopProduct.reserveFlag==1}">
								<span>是</span>
							</c:when>
						</c:choose>
				</td>--%>
				<td>
					<%--<c:forEach items="${tbShopProduct.productAttr}" var="attr">
						${attr.productAttrOption}&nbsp;&nbsp;
					</c:forEach>--%>
						${tbShopProduct.color}
				</td>
				<td>
						${tbShopProduct.price}
				</td>
				<c:choose>
					<c:when test="${overse eq 1}">
					</c:when>
					<c:otherwise>
						<td>${tbShopProduct.storeNum}</td>
					</c:otherwise>
				</c:choose>

				<td>
					<c:choose>
						<c:when test="${overse eq 1}">
						${tbShopProduct.size}
						</c:when>
						<c:otherwise>
							${tbShopProduct.productSize}
						</c:otherwise>
					</c:choose>
				</td>
				<td>
					<c:choose>
						<c:when test="${tbShopProduct.isUseMqWallet==0}">
							<span>否</span>
						</c:when>
						<c:when test="${tbShopProduct.isUseMqWallet==1}">
							<span>是</span>
						</c:when>
					</c:choose>
				</td>
				<td>

					<c:choose>
						<c:when test="${tbShopProduct.shopCategoyr==4}">生活预定</c:when>
						<c:when test="${tbShopProduct.shopCategoyr==3}">便利生活</c:when>
						<c:when test="${tbShopProduct.shopCategoyr==2}">海外代购</c:when>
					</c:choose>
				</td>
				<td>
					<c:choose>
						<c:when test="${tbShopProduct.status==1}">
							<span>已上架</span>
						</c:when>
						<c:when test="${tbShopProduct.status==0}">
							<span>已下架</span>
						</c:when>
					</c:choose>
				</td>
			<%--	<td>
					<fmt:formatDate value="${tbShopProduct.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>--%>
				<td>
					<c:choose>
						<c:when test="${tbShopProduct.status==1}">
							<span><a href="${ctx}/sys/tbShopProduct/updateStatus?id=${tbShopProduct.id}&status=0" onclick="return confirmx('确认要下架该商品吗？', this.href)">下架</a></span>
						</c:when>
						<c:when test="${tbShopProduct.status==0}">
							<span><a href="${ctx}/sys/tbShopProduct/updateStatus?id=${tbShopProduct.id}&status=1">上架</a></span>
						</c:when>
					</c:choose>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>